package com.bootdo.activiti.Listener;

import org.activiti.engine.TaskService;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class TestExecutionListener implements ExecutionListener {
    @Autowired
    TaskService taskService;

    @Override
    public void notify(DelegateExecution execution) throws Exception {
        String eventName = execution.getEventName();
        // start
        if ("start".equals(eventName)) {
            System.out.println("start=========success");
            // 测试自动执行

        }else if ("end".equals(eventName)) {
            System.out.println("end=========success");
        }

    }
}
